<?php
/**
 * 微日记WIDGET
 *
 * @package  Basic
 * @author   Wing <wxywing@gmail.com>
 * @version  $Id: DailyWidget.class.php Thu Apr 26 06:33:45 GMT 2012 wing $ 
 */
class DailyWidget extends Widget {
	
	public function render($data)
	{
		if(empty($data['type']))		$data['type']		= 'weibo_daily';
		if(empty($data['feed_uid']))	$data['feed_uid']	= $_SESSION['mid'];

		return $this->renderFile( $data );
	}

	protected function renderFile( $data,$charset = 'utf-8' )
	{
		if(empty($data['type']))		$data['type']		= 'weibo_daily';
		if(empty($data['feed_uid']))	$data['feed_uid']	= $_SESSION['mid'];

		$templateFile =	ADDON_PATH . '/widgets/feed/Daily.html';
	
		$map = array();
		$list = service('MiniFeed')->getFeedByMap($map);
		
		$var['data'] = $list['data'];
		return parent::renderFile($templateFile, $var, $charset);
	}
}